//
//  BaseViewController.m
//  音悦咖
//
//  Created by Best on 15/7/13.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)dealloc
{
    [_titleLabel release];
    [_naviBarView release];
    [_leftButton release];
    [_rightButton release];
    [super dealloc];
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationController.navigationBarHidden = YES;
    

    
    self.view.backgroundColor = [UIColor clearColor];
    [self createNormalView];
    
}


#pragma mark 创建 Collection
- (void)createNormalView
{
    
    self.blackImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 64)];
    [self.view addSubview:self.blackImageView];
    self.blackImageView.image = [UIImage imageWithContentsOfFile:GETBUNDLE_PATH(@"color", @"jpg")];
//    self.blackImageView.backgroundColor = [UIColor whiteColor];
    self.blackImageView.userInteractionEnabled = YES;
    [_blackImageView release];
    // NaviView
    self.naviBarView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 64)];
    
    
    self.naviBarView.tag = 999999;
    
    self.naviBarView.backgroundColor = [UIColor clearColor];
//    self.naviBarView.backgroundColor = [UIColor clearColor];
//    [self.blackImageView addSubview:self.naviBarView];
    [self.view addSubview:self.naviBarView];
    [_naviBarView release];
    //LeftButton
    self.leftButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    self.leftButton.frame = CGRectMake(10, 30, 30, 30);
    [self.leftButton setImage:[UIImage imageNamed:@"backbutton"] forState:(UIControlStateNormal)];
    [self.leftButton addTarget:self action:@selector(leftButtonAction) forControlEvents:UIControlEventTouchUpInside];
    [self.naviBarView addSubview:self.leftButton];
    self.leftButton.userInteractionEnabled = YES;
    
    
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.leftButton.frame.origin.x + self.leftButton.frame.size.width, self.leftButton.frame.origin.y, SCREEN_WIDTH - 2 * self.leftButton.frame.size.width, self.leftButton.frame.size.height)];
    [self.naviBarView addSubview:self.titleLabel];
    self.titleLabel.font = [UIFont systemFontOfSize:20];
    self.titleLabel.textColor = [UIColor whiteColor];
    [self.titleLabel setTextAlignment:(NSTextAlignmentCenter)];
    [_titleLabel release];
    
    
    
    
    
 
}







#pragma mark - 左键点击方法
- (void)leftButtonAction
{
    [self.navigationController popViewControllerAnimated:YES];
    
}

#pragma mark - 右键点击方法
- (void)rightButtonAction
{
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}





/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
